package net.hands.common.mail;

import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;
/**
 * 说明:简单认证
 * <br>
 * <p>这是一个开源的软件，请在LGPLv3下合法使用、修改或重新发布。</p>
 * @author 陈侃(cknet@126.com, 13910090885)
 *         http://code.google.com/p/simpleframework/
 *         http://www.simpleframework.net
 */
public class SimpleAuthenticator extends Authenticator {
   /**
    * 用户名
    */
	protected final String username;
   /**
    * 密码
    */
	protected final String password;
   /**
    * 
   * Constructor Method  
   * @update 2012-9-21 下午2:44:46  
   * @param username 用户
   * @param password 密码
    */
	public SimpleAuthenticator(final String username, final String password) {
		super();
		this.username = username;
		this.password = password;
	}
   /**
    * 
   (non-Javadoc)  
   * @see javax.mail.Authenticator#getPasswordAuthentication()  
   * @update 2012-9-21 下午2:44:53
    */
	@Override
	public PasswordAuthentication getPasswordAuthentication() {
		return new PasswordAuthentication(username, password);
	}
}
